3.8.30 \(\int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^3}{(a+i a \tan (e+f x))^3} \, dx\) [730]

Optimal. Leaf size=135 \[ -\frac {i B c^3 x}{a^3}+\frac {B c^3 \log (\cos (e+f x))}{a^3 f}-\frac {2 B c^3}{a^3 f (i-\tan (e+f x))^2}-\frac {4 i B c^3}{a^3 f (i-\tan (e+f x))}+\frac {(i A-B) c^3 (1-i \tan (e+f x))^3}{6 a^3 f (1+i \tan (e+f x))^3} \]

[Out]

-I*B*c^3*x/a^3+B*c^3*ln(cos(f*x+e))/a^3/f-2*B*c^3/a^3/f/(I-tan(f*x+e))^2-4*I*B*c^3/a^3/f/(I-tan(f*x+e))+1/6*(I
*A-B)*c^3*(1-I*tan(f*x+e))^3/a^3/f/(1+I*tan(f*x+e))^3

________________________________________________________________________________________

Rubi [A]
time = 0.11, antiderivative size = 135, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.073, Rules used = {3669, 79, 45} \begin {gather*} \frac {c^3 (-B+i A) (1-i \tan (e+f x))^3}{6 a^3 f (1+i \tan (e+f x))^3}-\frac {4 i B c^3}{a^3 f (-\tan (e+f x)+i)}-\frac {2 B c^3}{a^3 f (-\tan (e+f x)+i)^2}+\frac {B c^3 \log (\cos (e+f x))}{a^3 f}-\frac {i B c^3 x}{a^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^3)/(a + I*a*Tan[e + f*x])^3,x]

[Out]

((-I)*B*c^3*x)/a^3 + (B*c^3*Log[Cos[e + f*x]])/(a^3*f) - (2*B*c^3)/(a^3*f*(I - Tan[e + f*x])^2) - ((4*I)*B*c^3
)/(a^3*f*(I - Tan[e + f*x])) + ((I*A - B)*c^3*(1 - I*Tan[e + f*x])^3)/(6*a^3*f*(1 + I*Tan[e + f*x])^3)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 79

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(-(b*e - a*f
))*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(f*(p + 1)*(c*f - d*e))), x] - Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1
) + c*f*(p + 1)))/(f*(p + 1)*(c*f - d*e)), Int[(c + d*x)^n*(e + f*x)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e,
f, n}, x] && LtQ[p, -1] && ( !LtQ[n, -1] || IntegerQ[p] ||  !(IntegerQ[n] ||  !(EqQ[e, 0] ||  !(EqQ[c, 0] || L
tQ[p, n]))))

Rule 3669

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a*(c/f), Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^3}{(a+i a \tan (e+f x))^3} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {(A+B x) (c-i c x)^2}{(a+i a x)^4} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(i A-B) c^3 (1-i \tan (e+f x))^3}{6 a^3 f (1+i \tan (e+f x))^3}-\frac {(i B c) \text {Subst}\left (\int \frac {(c-i c x)^2}{(a+i a x)^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(i A-B) c^3 (1-i \tan (e+f x))^3}{6 a^3 f (1+i \tan (e+f x))^3}-\frac {(i B c) \text {Subst}\left (\int \left (\frac {4 i c^2}{a^3 (-i+x)^3}+\frac {4 c^2}{a^3 (-i+x)^2}-\frac {i c^2}{a^3 (-i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {i B c^3 x}{a^3}+\frac {B c^3 \log (\cos (e+f x))}{a^3 f}-\frac {2 B c^3}{a^3 f (i-\tan (e+f x))^2}-\frac {4 i B c^3}{a^3 f (i-\tan (e+f x))}+\frac {(i A-B) c^3 (1-i \tan (e+f x))^3}{6 a^3 f (1+i \tan (e+f x))^3}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 1.41, size = 145, normalized size = 1.07 \begin {gather*} \frac {c^3 \sec ^3(e+f x) (-3 i B \cos (e+f x)-\cos (3 (e+f x)) (A+i B-6 B f x-6 i B \log (\cos (e+f x)))+9 B \sin (e+f x)+i A \sin (3 (e+f x))-B \sin (3 (e+f x))+6 i B f x \sin (3 (e+f x))-6 B \log (\cos (e+f x)) \sin (3 (e+f x)))}{6 a^3 f (-i+\tan (e+f x))^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^3)/(a + I*a*Tan[e + f*x])^3,x]

[Out]

(c^3*Sec[e + f*x]^3*((-3*I)*B*Cos[e + f*x] - Cos[3*(e + f*x)]*(A + I*B - 6*B*f*x - (6*I)*B*Log[Cos[e + f*x]])
+ 9*B*Sin[e + f*x] + I*A*Sin[3*(e + f*x)] - B*Sin[3*(e + f*x)] + (6*I)*B*f*x*Sin[3*(e + f*x)] - 6*B*Log[Cos[e
+ f*x]]*Sin[3*(e + f*x)]))/(6*a^3*f*(-I + Tan[e + f*x])^3)

________________________________________________________________________________________

Maple [A]
time = 0.28, size = 88, normalized size = 0.65

method result size
derivativedivides \(\frac {c^{3} \left (-\frac {-4 i A +8 B}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {-5 i B -A}{-i+\tan \left (f x +e \right )}-B \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {4 i B +4 A}{3 \left (-i+\tan \left (f x +e \right )\right )^{3}}\right )}{f \,a^{3}}\) \(88\)
default \(\frac {c^{3} \left (-\frac {-4 i A +8 B}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {-5 i B -A}{-i+\tan \left (f x +e \right )}-B \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {4 i B +4 A}{3 \left (-i+\tan \left (f x +e \right )\right )^{3}}\right )}{f \,a^{3}}\) \(88\)
risch \(-\frac {B \,c^{3} {\mathrm e}^{-2 i \left (f x +e \right )}}{a^{3} f}+\frac {B \,c^{3} {\mathrm e}^{-4 i \left (f x +e \right )}}{2 a^{3} f}-\frac {c^{3} {\mathrm e}^{-6 i \left (f x +e \right )} B}{6 a^{3} f}+\frac {i c^{3} {\mathrm e}^{-6 i \left (f x +e \right )} A}{6 a^{3} f}-\frac {2 i B \,c^{3} x}{a^{3}}-\frac {2 i B \,c^{3} e}{a^{3} f}+\frac {B \,c^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{a^{3} f}\) \(135\)
norman \(\frac {\frac {\left (i B \,c^{3}+A \,c^{3}\right ) \tan \left (f x +e \right )}{a f}+\frac {\left (5 i B \,c^{3}+A \,c^{3}\right ) \left (\tan ^{5}\left (f x +e \right )\right )}{a f}-\frac {-i c^{3} A +7 B \,c^{3}}{3 a f}-\frac {2 \left (-i B \,c^{3}+5 A \,c^{3}\right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3 a f}-\frac {3 \left (-i c^{3} A +3 B \,c^{3}\right ) \left (\tan ^{4}\left (f x +e \right )\right )}{a f}-\frac {\left (2 i c^{3} A +6 B \,c^{3}\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{a f}-\frac {i c^{3} B x}{a}-\frac {3 i c^{3} B x \left (\tan ^{2}\left (f x +e \right )\right )}{a}-\frac {3 i c^{3} B x \left (\tan ^{4}\left (f x +e \right )\right )}{a}-\frac {i c^{3} B x \left (\tan ^{6}\left (f x +e \right )\right )}{a}}{a^{2} \left (1+\tan ^{2}\left (f x +e \right )\right )^{3}}-\frac {B \,c^{3} \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 a^{3} f}\) \(276\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^3/(a+I*a*tan(f*x+e))^3,x,method=_RETURNVERBOSE)

[Out]

1/f*c^3/a^3*(-1/2*(-4*I*A+8*B)/(-I+tan(f*x+e))^2-(-A-5*I*B)/(-I+tan(f*x+e))-B*ln(-I+tan(f*x+e))-1/3*(4*I*B+4*A
)/(-I+tan(f*x+e))^3)

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^3/(a+I*a*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

Fricas [A]
time = 3.16, size = 109, normalized size = 0.81 \begin {gather*} \frac {{\left (-12 i \, B c^{3} f x e^{\left (6 i \, f x + 6 i \, e\right )} + 6 \, B c^{3} e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 6 \, B c^{3} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, B c^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (i \, A - B\right )} c^{3}\right )} e^{\left (-6 i \, f x - 6 i \, e\right )}}{6 \, a^{3} f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^3/(a+I*a*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

1/6*(-12*I*B*c^3*f*x*e^(6*I*f*x + 6*I*e) + 6*B*c^3*e^(6*I*f*x + 6*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) - 6*B*c^3*
e^(4*I*f*x + 4*I*e) + 3*B*c^3*e^(2*I*f*x + 2*I*e) + (I*A - B)*c^3)*e^(-6*I*f*x - 6*I*e)/(a^3*f)

________________________________________________________________________________________

Sympy [A]
time = 0.46, size = 258, normalized size = 1.91 \begin {gather*} - \frac {2 i B c^{3} x}{a^{3}} + \frac {B c^{3} \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a^{3} f} + \begin {cases} \frac {\left (- 12 B a^{6} c^{3} f^{2} e^{10 i e} e^{- 2 i f x} + 6 B a^{6} c^{3} f^{2} e^{8 i e} e^{- 4 i f x} + \left (2 i A a^{6} c^{3} f^{2} e^{6 i e} - 2 B a^{6} c^{3} f^{2} e^{6 i e}\right ) e^{- 6 i f x}\right ) e^{- 12 i e}}{12 a^{9} f^{3}} & \text {for}\: a^{9} f^{3} e^{12 i e} \neq 0 \\x \left (\frac {2 i B c^{3}}{a^{3}} + \frac {\left (A c^{3} - 2 i B c^{3} e^{6 i e} + 2 i B c^{3} e^{4 i e} - 2 i B c^{3} e^{2 i e} + i B c^{3}\right ) e^{- 6 i e}}{a^{3}}\right ) & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))**3/(a+I*a*tan(f*x+e))**3,x)

[Out]

-2*I*B*c**3*x/a**3 + B*c**3*log(exp(2*I*f*x) + exp(-2*I*e))/(a**3*f) + Piecewise(((-12*B*a**6*c**3*f**2*exp(10
*I*e)*exp(-2*I*f*x) + 6*B*a**6*c**3*f**2*exp(8*I*e)*exp(-4*I*f*x) + (2*I*A*a**6*c**3*f**2*exp(6*I*e) - 2*B*a**
6*c**3*f**2*exp(6*I*e))*exp(-6*I*f*x))*exp(-12*I*e)/(12*a**9*f**3), Ne(a**9*f**3*exp(12*I*e), 0)), (x*(2*I*B*c
**3/a**3 + (A*c**3 - 2*I*B*c**3*exp(6*I*e) + 2*I*B*c**3*exp(4*I*e) - 2*I*B*c**3*exp(2*I*e) + I*B*c**3)*exp(-6*
I*e)/a**3), True))

________________________________________________________________________________________

Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 255 vs. \(2 (118) = 236\).
time = 0.98, size = 255, normalized size = 1.89 \begin {gather*} \frac {\frac {30 \, B c^{3} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{a^{3}} - \frac {60 \, B c^{3} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}{a^{3}} + \frac {30 \, B c^{3} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{a^{3}} + \frac {147 \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} - 60 \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 942 i \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 2445 \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 200 \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 3620 i \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 2445 \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 60 \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 942 i \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 147 \, B c^{3}}{a^{3} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}^{6}}}{30 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^3/(a+I*a*tan(f*x+e))^3,x, algorithm="giac")

[Out]

1/30*(30*B*c^3*log(tan(1/2*f*x + 1/2*e) + 1)/a^3 - 60*B*c^3*log(tan(1/2*f*x + 1/2*e) - I)/a^3 + 30*B*c^3*log(t
an(1/2*f*x + 1/2*e) - 1)/a^3 + (147*B*c^3*tan(1/2*f*x + 1/2*e)^6 - 60*A*c^3*tan(1/2*f*x + 1/2*e)^5 - 942*I*B*c
^3*tan(1/2*f*x + 1/2*e)^5 - 2445*B*c^3*tan(1/2*f*x + 1/2*e)^4 + 200*A*c^3*tan(1/2*f*x + 1/2*e)^3 + 3620*I*B*c^
3*tan(1/2*f*x + 1/2*e)^3 + 2445*B*c^3*tan(1/2*f*x + 1/2*e)^2 - 60*A*c^3*tan(1/2*f*x + 1/2*e) - 942*I*B*c^3*tan
(1/2*f*x + 1/2*e) - 147*B*c^3)/(a^3*(tan(1/2*f*x + 1/2*e) - I)^6))/f

________________________________________________________________________________________

Mupad [B]
time = 8.96, size = 149, normalized size = 1.10 \begin {gather*} -\frac {c^3\,\left (18\,B\,\mathrm {tan}\left (e+f\,x\right )-B\,7{}\mathrm {i}-A-B\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,3{}\mathrm {i}+3\,A\,{\mathrm {tan}\left (e+f\,x\right )}^2+B\,{\mathrm {tan}\left (e+f\,x\right )}^2\,15{}\mathrm {i}+B\,{\mathrm {tan}\left (e+f\,x\right )}^2\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,9{}\mathrm {i}-3\,B\,{\mathrm {tan}\left (e+f\,x\right )}^3\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )+9\,B\,\mathrm {tan}\left (e+f\,x\right )\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\right )\,1{}\mathrm {i}}{3\,a^3\,f\,{\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*tan(e + f*x))*(c - c*tan(e + f*x)*1i)^3)/(a + a*tan(e + f*x)*1i)^3,x)

[Out]

-(c^3*(18*B*tan(e + f*x) - B*7i - A - B*log(- tan(e + f*x)*1i - 1)*3i + 3*A*tan(e + f*x)^2 + B*tan(e + f*x)^2*
15i + B*tan(e + f*x)^2*log(- tan(e + f*x)*1i - 1)*9i - 3*B*tan(e + f*x)^3*log(- tan(e + f*x)*1i - 1) + 9*B*tan
(e + f*x)*log(- tan(e + f*x)*1i - 1))*1i)/(3*a^3*f*(tan(e + f*x)*1i + 1)^3)

________________________________________________________________________________________